<!--
 * @description  : 市管-市场净化率计划item
 * @descriptionDetail: 市管-市场净化率计划item
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-08-09 14:43:02
-->
<template>
  <view>
    <view class="lt-root" @tap="itemClick">
      <view class="lt-row-space">
        <view>
          <text class="lt-right-value value-title">
            {{ itemInfo.planName }}
          </text>
        </view>
        <view>
          <u-tag style="flex-shrink: 0;" :spStyle="getSpStyle(itemInfo)" mode="dark" shape="circle" :text="itemInfo.statusText"></u-tag>
        </view>
      </view>
      <view class="lt-row">
        <text class="lt-left-label">
          每单位样本数：
        </text>
        <text class="lt-right-value">
          {{ itemInfo.checkCount }}
        </text>
      </view>
      <view class="lt-row" style="padding-bottom:24rpx;border-bottom:1px solid #DFE0E1">
        <text class="lt-left-label">
          组织单位：
        </text>
        <text class="lt-right-value">
          {{ itemInfo.orgName }}
        </text>
      </view>
      <view class="time-sty">
        <view class="lt-row">
          <text class="lt-left-label label-sty">
            开始时间：
          </text>
          <text class="lt-right-value label-sty">
            {{ itemInfo.startDate }}
          </text>
        </view>
        <view class="lt-row">
          <text class="lt-left-label label-sty">
            结束时间：
          </text>
          <text class="lt-right-value label-sty">
            {{ itemInfo.endDate }}
          </text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import {M_SAMPLING_STATUS,} from "@/service/check/mapping/enum.js";
const sysCodeColors = {
  "03": {
    color: "#EC7C37",
    borderColor: "#EC7C37",
    backgroundColor: "#FBE2D3",
  },
  "01": {
    color: "#20AB5C",
    borderColor: "#20AB5C",
    backgroundColor: "#DBF4E6",
  },
};
export default{
  name:"ListItemMprEvaluationPlan",
  props:{
    itemInfo:{
      type: Object,
      default:() => { return {} },
    },
  },
  data(){
    return {
		
    };
  },
  created() {
	
  },
  methods:{
    itemClick(){
      this.setRouteParam(this.itemInfo);
      // 跳转到 窝点的详情页面
      this.$u.route("pages/mprEvaluation/mprEvaluationList");
    },
    getSpStyle(it){
      if(it.status == M_SAMPLING_STATUS.YIFABU){
        return sysCodeColors[it.status] || {};
      }else if(it.status == M_SAMPLING_STATUS.END){
        return sysCodeColors[it.status] || {};
      }
    },
  },
}
</script>

<style scoped lang="scss">
@import "../list_item.scss";
.time-sty{
  display: flex;
  justify-content: space-between;
}
.label-sty{
  font-size: 26rpx;
  color: #989EA1;
}
.value-title{
  font-size: 32rpx;
  color: #393B3D;
  font-weight: bold;
  margin-left: 0;
}
.lt-root{
  padding: 10px !important;
  border-radius: 15px !important;
}
</style>